package com.sm.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import com.sm.dao.interfaces.StudentMapper;
import com.sm.entity.Student;
import com.sm.entity.StudentExample;
import com.sm.service.interfaces.StudentService;
@Service("studentService")
public class StudentServiceImpl implements StudentService {
	
	@Autowired
	@Qualifier("studentMapper1")
	private StudentMapper studentMapper1 ;

	@Autowired
	private StudentMapper studentMapper ;
	
	/**
	 * 注入自己写的dao实现类,dao实现类的注册bean名:@Repository("studentMapper1"),
	 * 因为配置文件中使用了MapperScannerConfigurer自动扫描dao接口,自动实现它的实现类名称默认是接口名首字母小写
	**/
	public Student selectByPrimaryKey(Integer id) {

		return studentMapper1.selectByPrimaryKey(id);
	}
	
	/**
	 * 使用MapperScannerConfigurer自动扫描dao接口,自动实现它的实现类名称默认是接口名首字母小写
	 * 此处不会打印我自己实现的dao中的log日志
	**/
	@Override
	public List<Student> selectByExample(StudentExample example) {
		return studentMapper.selectByExample(example);
	}
	
	@Override
	public long countByExample(StudentExample example) {
		return studentMapper1.countByExample(example);
	}

	@Override
	public int deleteByExample(StudentExample example) {
		return studentMapper1.deleteByExample(example);
	}

	@Override
	public int deleteByPrimaryKey(Integer id) {
		return studentMapper1.deleteByPrimaryKey(id);
	}

	@Override
	public int insert(Student record) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int insertSelective(Student record) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int updateByExampleSelective(Student record, StudentExample example) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int updateByExample(Student record, StudentExample example) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int updateByPrimaryKeySelective(Student record) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int updateByPrimaryKey(Student record) {
		// TODO Auto-generated method stub
		return 0;
	}
	
	

}
